{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Challenge: Combining Branches and Loops\n",
        "\n",
        "Watch the full [C# 101 video](https://www.youtube.com/watch?v=qK7tUpaOXi8&list=PLdo4fOcmZ0oVxKLQCHpiUWun7vlJJvUiN&index=11) for this module.\n",
        "\n",
        "Here's a challenge:\n",
        ">\n",
        "> See if you can write C# code to find the sum of all integers 1 through 20 that are divisible by 3.\n",
        ">\n",
        "First, try on your own in this notebook below, or in Visual Studio, or in Visual Studio Code."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Challenge\r\n"
          ]
        }
      ],
      "source": [
        "Console.WriteLine(\"Challenge\");"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Tips and tricks\n",
        "\n",
        "- The `%` operator gives you the remainder of a division operation.\n",
        "- The `if` statement gives you the condition to see if a number should be part of the sum.\n",
        "- The `for` loop can help you repeat a series of steps for all the numbers 1 through 20.\n",
        "- Getting a weird answer? try making some print statements of your variables, to see it they're changing unexpectedly.\n",
        "\n",
        "## Check your answer\n",
        "\n",
        "Your final answer should be 63.\n",
        "\n",
        "## Get help\n",
        "\n",
        "Feeling stuck?\n",
        "\n",
        "- Watch along on the [video](https://www.youtube.com/watch?v=qK7tUpaOXi8&list=PLdo4fOcmZ0oVxKLQCHpiUWun7vlJJvUiN&index=11) to see someone work through the problem. Once you get a feel for it, try pausing and finishing the code yourself!\n",
        "- Check your [answer](https://github.com/dotnet/samples/blob/main/csharp/branches-quickstart/Program.cs#L87-L95)."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Continue learning\n",
        "\n",
        "There are plenty more resources out there to learn!\n",
        "> [⏩ Next Module - Arrays, Lists, and Collections](https://ntbk.io/csharp101-notebook10)\n",
        ">\n",
        "> [⏪ Last Module - What Are Loops](https://ntbk.io/csharp101-notebook08)\n",
        ">\n",
        "> [Watch the video](https://www.youtube.com/watch?v=qK7tUpaOXi8&list=PLdo4fOcmZ0oVxKLQCHpiUWun7vlJJvUiN&index=11)\n",
        ">\n",
        "> [Documentation: Branches and Loops in C#](https://docs.microsoft.com/dotnet/csharp/tour-of-csharp/tutorials/branches-and-loops-local?WT.mc_id=Educationalcsharp-c9-scottha)\n",
        ">\n",
        "> [Start at the beginning: What is C#?](https://www.youtube.com/watch?v=BM4CHBmAPh4&list=PLdo4fOcmZ0oVxKLQCHpiUWun7vlJJvUiN&index=1)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Other resources\n",
        "\n",
        "Here's some more places to explore:\n",
        "> [Other 101 Videos](https://dotnet.microsoft.com/learn/videos?WT.mc_id=csharpnotebook-35129-website)\n",
        ">\n",
        "> [Microsoft Learn](https://docs.microsoft.com/learn/dotnet/?WT.mc_id=csharpnotebook-35129-website)\n",
        ">\n",
        "> [C# Documentation](https://docs.microsoft.com/dotnet/csharp/?WT.mc_id=csharpnotebook-35129-website)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": ".NET (C#)",
      "language": "C#",
      "name": ".net-csharp"
    },
    "language_info": {
      "file_extension": ".cs",
      "mimetype": "text/x-csharp",
      "name": "C#",
      "pygments_lexer": "csharp",
      "version": "8.0"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}
